package com.tanhan.mindapp.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tanhan.mindapp.dao.SysMenu;
import com.tanhan.mindapp.dao.SysRole;
import com.tanhan.mindapp.dao.SysRoleDTO.SysRoleQueryDTO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface SysRoleService extends IService<SysRole> {
    @Transactional(rollbackFor = Exception.class)
    boolean deleteRole(Long roleId);

    @Transactional(rollbackFor = Exception.class)
    boolean deleteBatchRoles(List<Long> roleIds);

    boolean isRoleInUse(Long roleId);

    IPage<SysRole> selectRolePage(SysRoleQueryDTO sysRoleQueryDTO);

    @Transactional(rollbackFor = Exception.class)
    boolean assignMenuPermissions(String roleId, List<String> menuIds);

    List<String> getMenuPermissions(String roleId);

    List<SysMenu> getMenuList(String roleId);
}
